package com.oa.oaspcpersonalcenterapi.api;


import com.oa.oaspccommon.po.Salary;
import com.oa.oaspcpersonalcenterapi.fallback.SalaryServiceApiFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * Created by jeffrey on 2021/4/13.
 */
@FeignClient(value="personalcenter-service", fallback = SalaryServiceApiFallback.class)
public interface SalaryServiceApi {

    //    查询所有
    @RequestMapping(value = "/salarys", method = RequestMethod.GET)
    public List<Salary> findSalarys();

    //    查询单个
    @RequestMapping(value = "/salary/{uid}&{sid}", method = RequestMethod.GET)
    public Salary findSalaryByUidAndSid(@PathVariable("uid") int uid, @PathVariable("sid") double sid);

    //    增加
    @RequestMapping(value = "/salary", method = RequestMethod.POST)
    public boolean addSalary(@RequestBody Salary salary);

    //    修改
    @RequestMapping(value = "/salary", method = RequestMethod.PUT)
    public boolean updateSalary(@RequestBody Salary salary);

    //    删除
    @RequestMapping(value = "/salary", method = RequestMethod.DELETE)
    public boolean deleteSalaryByUidAndSid(@RequestParam(value = "uid") int uid, @RequestParam(value = "sid") double sid);
}
